#include <stdio.h>

int distributeCandies(int* candyType, int candyTypeSize)
{
    int count = 1;
    int n = candyTypeSize / 2;
    for(int i = 1;i < candyTypeSize;i++)
    {
        if(candyType[i] != candyType[i - 1])
        {
            if(++count == n)
                return count;
        }
    }
    return count = count > 1 ? count : 1;
}

int main()
{
    int candyType[] = {1,1,2,3};
    int candyTypeSize = sizeof(candyType)/sizeof(candyType[0]);
    int n = distributeCandies(candyType,candyTypeSize);
    printf("%d\n",n);
    return 0;
}